package com.rc.evcharger.redis;


import com.rc.evcharger.common.annotation.Redis;
import com.rc.evcharger.common.annotation.RedisType;
import com.rc.evcharger.common.base.BaseRedis;

import java.util.ArrayList;
import java.util.List;

@Redis(table = "occupy")
public class RedOccupy extends BaseRedis {
    public static final String OCCUPY = "occupy";

    @Redis(type = RedisType.KEY)
    public String rtua;
    @Redis(type = RedisType.KEY)
    public String gunNum;
    @Redis(type = RedisType.VALUE)
    public List<String> value = new ArrayList<>();

    public RedOccupy() {
    }

    public RedOccupy(String rtua, String gunNum, Long memberId, Long endTime) {
        this.rtua = rtua;
        this.gunNum = gunNum;
        this.value.add(memberId + "");
        this.value.add(endTime + "");
    }

    public RedOccupy(String rtua, String gunNum) {
        this.rtua = rtua;
        this.gunNum = gunNum;
    }

    public String getRtua() {
        return rtua;
    }

    public void setRtua(String rtua) {
        this.rtua = rtua;
    }

    public String getGunNum() {
        return gunNum;
    }

    public void setGunNum(String gunNum) {
        this.gunNum = gunNum;
    }

    @Override
    public List<String> getValue() {
        return value;
    }

    public void setValue(List<String> value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "Occupy{" +
                "rtua='" + rtua + '\'' +
                ", gunNum='" + gunNum + '\'' +
                ", value=" + value +
                '}';
    }
}
